class SaleRecordsController < ApplicationController
  def create
    @sale_record = SaleRecord.new(sale_record_params)
    if @sale_record.save
      render_success('售后服务申请成功，敬请等待客服联系')
    else
      render_fail('售后服务申请失败，请重新申请')
    end
  end

  private

  def sale_record_params
    params.require(:sale_record).permit(:name, :mobile, :address, :purchase_date, :product_no, :demand)
  end
end
